import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'


Vue.use(VueRouter)

const routes = [{
		path: '/',
		name: 'Home',
		component: Home
	},
	{
		path: '/login',
		name: 'login',
		component: function() {
			return import('../components/main/Login.vue')
		}
	},
	{
		path: '/SetUp',
		name: 'SetUp',
		component: function() {
			return import('../components/main/SetUp.vue')
		}
	},
	{
		path: '/details',
		name: 'details',
		component: function() {
			return import('../views/Details.vue')
		}
	},
	{
		path: '/cart',
		name: 'cart',
		component: function() {
			return import('../views/cart.vue')
		}
	},
	{
		path: '/navfl',
		name: 'navfl',
		component: function() {
			return import('../components/navFl/navfl.vue')
		}
	},
	{
		path: '/mine',
		name: 'mine',
		component: function() {
			return import('../views/mine.vue')
		}
	},
	{
		path: '/search',
		name: 'search',
		component: function() {
			return import('../views/Search.vue')
		}
	},
	{
		path: '/Interest',
		name: 'Interest',
		component: function() {
			return import('../components/main/Interest.vue')
		}
	},
	// 路由懒加载 形式
	{
		path: '/about',
		name: 'About',
		// route level code-splitting
		// this generates a separate chunk (about.[hash].js) for this route
		// which is lazy-loaded when the route is visited.
		component: function() {
			return import('../views/About.vue')
		}
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
